package org.jing.ext.media.m3u8.tag;

import org.jing.core.util.ClassUtil;
import org.jing.ext.media.m3u8.BaseM3U8Tag;
import org.jing.ext.media.m3u8.M3U8TagType;
import org.jing.ext.media.m3u8.M3U8TagTypeInfo;

/**
 * Description: <br>
 *
 * @author bksmate <br>
 * @since 2024-12-24 <br>
 */
@M3U8TagTypeInfo(M3U8TagType.EXT_X_TARGETDURATION)
public class M3U8TargetDuration extends BaseM3U8Tag {
    private double targetDuration;

    @Override public void setParameter(String value) {
        setTargetDuration(ClassUtil.cast2Number(value).doubleValue());
    }

    @Override protected String outputValue() {
        return String.format("%.6f", targetDuration);
    }

    public double getTargetDuration() {
        return targetDuration;
    }

    public void setTargetDuration(double targetDuration) {
        this.targetDuration = targetDuration;
    }
}
